﻿using System;

namespace SIR.Common
{
	/// <summary>
	/// Defined access rights for the database
	/// </summary>
	public enum DatabaseAccessRights
	{
		None = 0x00,
		Read = 0x01,
		Write = 0x02,
		ReadWrite = Read | Write
	}

	/// <summary>
	/// Access attribute for entity properties
	/// </summary>
	[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
	public sealed class DatabaseAccessAttribute : Attribute
	{
		public DatabaseAccessAttribute(DatabaseAccessRights rights)
		{
			Rights = rights;
		}

		/// <summary>
		/// The access rights of the property
		/// </summary>
		public DatabaseAccessRights Rights { get; private set; }
	}
}
